package com.own.component.util.excel.util.read.model;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.poi.ss.util.CellRangeAddress;

import java.io.Serializable;

/**
 * MergedValueData
 *
 * @author chenxueli
 * @date 2022-10-14 11:25:00
 */
@Data
@NoArgsConstructor
public class MergedValueData implements Serializable {

    /**
     * 首行
     */
    private int firstRow;

    /**
     * 末行
     */
    private int lastRow;

    /**
     * 首列
     */
    private int firstColumn;

    /**
     * 末列
     */
    private int lastColumn;

    /**
     * 值
     */
    private String value;

    public MergedValueData(String value, CellRangeAddress range) {
        this.value = value;
        this.firstRow = range.getFirstRow();
        this.lastRow = range.getLastRow();
        this.firstColumn = range.getFirstColumn();
        this.lastColumn = range.getLastColumn();
    }

}
